using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace Slf.Samples.Shared.ClassLibrary
{
  public static class MathsLibrary
  {
    private static ILogger log = LoggerService.GetLogger("MathsLib");

    private static ILogger logDetail = LoggerService.GetLogger("MathsLib.Detail");

    /// <summary>
    /// Computes the factorial of the given number
    /// </summary>
    public static int Factorial(int number)
    {
      log.Info("Computing Factorial");

      int result = 1;
      for (int i = 1; i < number; i++)
      {
        result *= i;
        logDetail.Debug(string.Format("Factorial current total: {0}", result));
      }
      return result;
    }
  }
}